<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<h2>New Contact</h2>

<c:if  test="${!empty contactForm.parent}">
	<c:set var="parent" value="${contactForm.parent}" scope="request" /> 
	<div class="parent-wrapper">
		<div style="float:left;font-weight: bold;padding-right:5px;">Parent:</div>
		<jsp:include page="parent_recurse.jsp" />
	</div>
	<br/><br/><br/>
</c:if>

<form:form method="post" modelAttribute="contactForm">
	<s:bind path="*">
		<c:if test="${status.error}">
			<div id="errormessage" class="error">Form has errors</div>
		</c:if>
	</s:bind>
	<form:hidden path="id"/>
	<form:hidden path="parentId"/>
	
	<div class="basic-field-wrapper">
		<form:label path="lastName" >Last Name / Group Name </form:label><form:errors path="lastName" cssClass="error" /><br/>
		<form:input path="lastName" cssClass="basic-text-field" />
		<br/><br/>
		<form:label path="firstName" cssClass="basic-field-labbel">First Name</form:label>
		<form:input path="firstName" cssClass="basic-text-field"  />
		<br/><br/>
		<form:label path="workPhone" cssClass="basic-field-labbel">Work Phone</form:label>
		<form:input path="workPhone" cssClass="basic-text-field"  />
		<br/><br/>
		<form:label path="cellPhone" cssClass="basic-field-labbel">Cell Phone</form:label>
		<form:input path="cellPhone" cssClass="basic-text-field"  />
		<br/><br/>
		<form:label path="email" cssClass="basic-field-labbel">Email</form:label>
		<form:input path="email" cssClass="basic-text-field"  />
		<br/><br/>
		<form:label path="altEmail" cssClass="basic-field-labbel">Alt Email</form:label>
		<form:input path="altEmail" cssClass="basic-text-field"  />
		<br/><br/>
		<form:label path="url" cssClass="basic-field-labbel">URL</form:label>
		<form:input path="url" cssClass="basic-text-field"  />
		<br/><br/>
		<form:label path="tagId">Tag</form:label>
		<form:select path="tagId">
			<form:option value="0" label="Select" />
			<form:option value="1" label="Firm" />
			<form:option value="2" label="Rep" />
			<form:option value="3" label="Job" />
			<form:option value="4" label="Contact" />
		</form:select>
		<br/><br/>
		<c:url var="indexURL" value="/index" />
		<button type="button" onClick="location.href='${indexURL}'">Cancel</button>&nbsp;&nbsp;&nbsp;<button type="submit">Submit</button>
		
		
	</div>
	

</form:form>

<script>

$(function() {
	$( "button" ).button();
});



</script>